package org.gosdt.ew.view;

import javax.swing.JDialog;
import javax.swing.JFrame;


/**
 * Base class for all forms in current project
 * @author anton
 *
 */
public abstract class BaseForm extends JDialog {
	private static final long serialVersionUID = 1L;
	/** parent form*/
	protected MainForm myParent;

	/**
	 * constructor set size and positions, captions ... (common stile)
	 */
	public BaseForm (JFrame parent, String titleExtend) {
		if (parent != null) {
			this.setResizable(parent.isResizable());
			this.setModal(true);
			this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			this.setBounds(parent.getBounds());
			this.setTitle(parent.getTitle() + " - " + titleExtend);
			myParent = ((MainForm)parent);
			myParent.changeTimerStatus();
		}
	}
	/** abstract function for setting listeners on form */
	protected abstract void setButtonListeners(); // function which set a button actions
	/** abstract function for initializing form */
	protected abstract void doInitForm(); // function which setup a form view
	/** abstract function for set captions and text label on form*/
	protected abstract void setLabelsName(); // function which set a names for labels (it's for multilanguage)
}
